using System;

namespace Awesome.Extensions.Monads.Maybe
{
    public static class MaybeEx
    {
        public static TResult With<TSource, TResult>(this TSource source, Func<TSource, TResult> selector)
            where TSource : class
            where TResult : class
        {
            return source != null ? selector(source) : null;
        }
    }
}